<!DOCTYPE html>
<html lang="en">
	<head>
		<include file="Index/head" />
	</head>

	<body>
		<include file="Index/header" />

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<include file="Index/menu" />
				
				<div class="main-content">
					<include file="Index/nav" />

					<div class="page-content">
						
							<!-- /**
							 * 右侧页面begin
							 */ -->
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<form class="form-horizontal" role="form" action="{:U('Admin/System/modify_package')}" method="POST" >
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 套餐名: </label>

										<div class="col-sm-9">
											<input type="text" name="name" id="form-field-1" placeholder="套餐名" class="col-xs-10 col-sm-5" value="{$res['name']}">
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 套餐价格: </label>

										<div class="col-sm-9">
											<input type="text" id="form-field-2" placeholder="套餐价格" class="col-xs-10 col-sm-5" name="price" value="{$res['price']/100}">
										</div>
									</div>

									<div class="space-4"></div>


<!-- 									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 选择略缩图: </label>
										<div class="col-sm-8">
											<input type="file" id="form-field-2" class="col-xs-10 col-sm-5" name="photo">
										</div>
									</div>
 -->
 									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 套餐包含项目: </label>
											<div class="col-sm-5" >
											<volist name="items_lists" id="vo">
												<label style="margin-right:30px;"> 
												<input name="items[]" type="checkbox" class="ace" value="{$vo.id}" <if condition='$vo.checked eq 1'>  checked="checked" </if> >
												<span class="lbl">{$vo.name}</span>
												</label>
											</volist>
											</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 可选择机构: </label>

												<div class="col-sm-9">
												<volist name="institution_lists" id="ins">
												<label style="margin-right:30px;">
													<input name="organ[]" type="checkbox" class="ace" value="{$ins.id}" <if condition=" $ins.checked eq 1">checked="checked"</if> >
													<span class="lbl">{$ins.name}</span>
												</label>
												</volist>
												</div>
										
									</div>
									<input type="text" name="id" hidden="hidden" value="{$res.id}">
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 选择所属分类: </label>

										<div class="col-sm-9">
											<!-- <input type="password" id="form-field-2" placeholder="再次输入密码" class="col-xs-10 col-sm-5" name="password2"> -->
											<select name="classify" id="classify">
											<option value="">一级分类</option>
											<volist name="food_classify" id="food">
											<option value="{$food.id}">{$food.name}</option>
											</volist>
											</select>
											<label > &nbsp; &nbsp; &nbsp;原始分类：<b style="color:red;">{$res['classify']}</b>&nbsp; &nbsp; &nbsp; 从属分类: {$res['classifyid']}</label>
										</div>

									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 从属分类: </label>
											<div class="col-sm-9" id="classify_son">
<!-- 											<label id="classify_son" style="margin-right:20px;" >
												<input name="" type="checkbox" class="ace" value="" >
												<span class="lbl"></span>
											</label> -->
											</div>
									</div>
									<div class="space-4"></div>
						
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 检测内容: </label>
										<div class="col-sm-5">
											<div class="widget-box">
												<div class="widget-header widget-header-small header-color-blue">  </div>
												<div class="widget-body">
													<div class="widget-main no-padding">
														<textarea class="span12 md-input" name="content" data-provide="markdown" rows="10" style="resize: none;">{$res['content']}</textarea>
													</div>
													<div class="widget-toolbox padding-4 clearfix">
														<div class="btn-group pull-left">
														</div>
														<div class="btn-group pull-right">
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 相关知识介绍: </label>
										<div class="col-sm-5">
											<div class="widget-box">
												<div class="widget-header widget-header-small header-color-blue">  </div>
												<div class="widget-body">
													<div class="widget-main no-padding">
														<textarea class="span12 md-input" name="information" data-provide="markdown" rows="10" style="resize: none;">{$res['information']}</textarea>
													</div>
													<div class="widget-toolbox padding-4 clearfix">
														<div class="btn-group pull-left">
														</div>
														<div class="btn-group pull-right">
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
									
	
									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button class="btn btn-info" type="submit">
												<i class="icon-ok bigger-110"></i>
												保存
											</button>									
										&nbsp; &nbsp; &nbsp;
										<a href="{:U('Admin/System/package_lists')}">
											<button class="btn" type="button">
												<i class="icon-undo bigger-110"></i>
												返回
											</button>
										</a>
											
										</div>
									</div>

									<div class="hr hr-24"></div>

									</div><!-- /row -->

								</form>

						</div>
							<!-- /**
							 * 右侧页面end
							 */ -->
					</div><!-- /.page-content -->
				</div>

			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<include file="Index/footer" />
		<script type="text/javascript">
		$(document).ready(function(){
			$("#classify").change(function(){
				$("#classify_son").empty();
				var id=$("#classify").val();
				var url="{:U('Admin/System/ready_classify')}"
				$.ajax({
					type:'post',
					url:url,
					data:{id:id},
					dataType:'json',
					success: function(data){
						var str='';
						$.each(data,function(k,v){
							str+='<label style="margin-right:20px;" ><input name="classify_son[]" type="checkbox" class="ace" value="'+ v['id'] + '" >';
							str+='<span class="lbl">'+ v['name'] +'</span></label>'

						});

						$("#classify_son").append(str);
					}
				});
			});
		});
		</script>
	</body>
</html>
